Optimal. Leaf size=88 \[ \frac {c^2 \tanh ^{-1}(\sin (e+f x))}{a^2 f}-\frac {2 c^2 \tan (e+f x)}{f \left (a^2 \sec (e+f x)+a^2\right )}+\frac {2 \tan (e+f x) \left (c^2-c^2 \sec (e+f x)\right )}{3 f (a \sec (e+f x)+a)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {3957, 3770} \[ \frac {c^2 \tanh ^{-1}(\sin (e+f x))}{a^2 f}-\frac {2 c^2 \tan (e+f x)}{f \left (a^2 \sec (e+f x)+a^2\right )}+\frac {2 \tan (e+f x) \left (c^2-c^2 \sec (e+f x)\right )}{3 f (a \sec (e+f x)+a)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3770
Rule 3957
Rubi steps
\begin {align*} \int \frac {\sec (e+f x) (c-c \sec (e+f x))^2}{(a+a \sec (e+f x))^2} \, dx &=\frac {2 \left (c^2-c^2 \sec (e+f x)\right ) \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}-\frac {c \int \frac {\sec (e+f x) (c-c \sec (e+f x))}{a+a \sec (e+f x)} \, dx}{a}\\ &=-\frac {2 c^2 \tan (e+f x)}{f \left (a^2+a^2 \sec (e+f x)\right )}+\frac {2 \left (c^2-c^2 \sec (e+f x)\right ) \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}+\frac {c^2 \int \sec (e+f x) \, dx}{a^2}\\ &=\frac {c^2 \tanh ^{-1}(\sin (e+f x))}{a^2 f}-\frac {2 c^2 \tan (e+f x)}{f \left (a^2+a^2 \sec (e+f x)\right )}+\frac {2 \left (c^2-c^2 \sec (e+f x)\right ) \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.11, size = 109, normalized size = 1.24 \[ \frac {c^2 \left (-\frac {4 \tan \left (\frac {1}{2} (e+f x)\right )}{3 f}-\frac {2 \tan \left (\frac {1}{2} (e+f x)\right ) \sec ^2\left (\frac {1}{2} (e+f x)\right )}{3 f}-\frac {\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )}{f}+\frac {\log \left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right )}{f}\right )}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.63, size = 138, normalized size = 1.57 \[ \frac {3 \, {\left (c^{2} \cos \left (f x + e\right )^{2} + 2 \, c^{2} \cos \left (f x + e\right ) + c^{2}\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) - 3 \, {\left (c^{2} \cos \left (f x + e\right )^{2} + 2 \, c^{2} \cos \left (f x + e\right ) + c^{2}\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) - 8 \, {\left (c^{2} \cos \left (f x + e\right ) + 2 \, c^{2}\right )} \sin \left (f x + e\right )}{6 \, {\left (a^{2} f \cos \left (f x + e\right )^{2} + 2 \, a^{2} f \cos \left (f x + e\right ) + a^{2} f\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.82, size = 89, normalized size = 1.01 \[ -\frac {2 c^{2} \left (\tan ^{3}\left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{3 f \,a^{2}}-\frac {2 c^{2} \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{f \,a^{2}}-\frac {c^{2} \ln \left (\tan \left (\frac {e}{2}+\frac {f x}{2}\right )-1\right )}{f \,a^{2}}+\frac {c^{2} \ln \left (\tan \left (\frac {e}{2}+\frac {f x}{2}\right )+1\right )}{f \,a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.33, size = 196, normalized size = 2.23 \[ -\frac {c^{2} {\left (\frac {\frac {9 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}}{a^{2}} - \frac {6 \, \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{a^{2}} + \frac {6 \, \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{a^{2}}\right )} + \frac {2 \, c^{2} {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}{a^{2}} - \frac {c^{2} {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}{a^{2}}}{6 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.61, size = 46, normalized size = 0.52 \[ -\frac {2\,c^2\,\left (3\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )-3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\right )}{3\,a^2\,f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {c^{2} \left (\int \frac {\sec {\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \left (- \frac {2 \sec ^{2}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\right )\, dx + \int \frac {\sec ^{3}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx\right )}{a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________